package com.marisfrolg.util;

import java.util.List;

import com.marisfrolg.entity.Model;

public class StringUtil {
	public static boolean isEmpty(String string){
		return string==null||"".equals(string.trim());
	}

	public static String getModelXml(List<Model> ms) {
//		StringBuffer start=new StringBuffer("<?xml version=\"1.0\"?><ArrayOfItem xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">");
		StringBuffer value=new StringBuffer();
//		for (Model model : ms) {
//			value.append("<Item><ProductNumber>").append(model.getCodenumber()).append("</ProductNumber><Quantity>").append(model.quantity).append("</Quantity></Item>");
//		}
		for (Model model : ms) {
			value.append(model.getCodenumber()).append(",").append(model.quantity).append(";");
		}
		value.deleteCharAt(value.lastIndexOf(";"));
//		StringBuffer end=new StringBuffer("</ArrayOfItem>");
//		return start.append(value).append(end).toString();
		return value.toString();
	}
	public static boolean isBin(String code){
		return code.length()<10;
	}
}
